namespace Asmex.FileViewer
{
    using System;
    using System.IO;

    public class MDStringHeap : MDHeap
    {
        public MDStringHeap(BinaryReader reader, long offs, long size, string name)
        {
            reader.BaseStream.Position = offs;
            base.Start = offs;
            base.Length = size;
            base._name = name;
            string str = "";
            int key = (int) (reader.BaseStream.Position - offs);
            for (long i = offs; i < (offs + size); i += 1L)
            {
                char ch = reader.ReadChar();
                if (ch == '\0')
                {
                    base._data.Add(key, str);
                    str = "";
                    key = (int) (reader.BaseStream.Position - offs);
                }
                else
                {
                    str = str + ch;
                }
            }
        }
    }
}
